<template>
  <el-row>
    <el-input
      v-if="inpShow"
      v-model.trim="inputValue"
      placeholder="请输入内容"
      class="input-with-select"
      style="margin-right: 20px"
      clearable
      @clear="clears"
    >
      <el-button
        slot="append"
        icon="el-icon-search"
        @click="$emit('onSerach', inputValue)"
      />
    </el-input>
    <el-button v-if="btnShow" type="primary" @click="add">
      {{ btnText }}</el-button>
  </el-row>
</template>

<script>
export default {
  name: 'Headers',
  components: {},
  props: {
    inpShow: {
      type: Boolean,
      required: false
    },
    btnShow: {
      type: Boolean,
      required: false
    },
    btnText: {
      type: String,
      default: ''
    },
    thicknessIsShow: {
      type: Boolean,
      required: false
    }
  },
  data() {
    return {
      inputValue: null
    }
  },
  computed: {}, // 计算属性
  watch: {},
  created() {},
  mounted() {},
  methods: {
    add() {
      this.$emit('onShowhickness', !this.thicknessIsShow)
    },
    clears() {
      this.$emit('onSerach', '')
    }
  }
}
</script>

<style scoped>
.input-with-select {
  width: 391px;
}
</style>
